package com.naiterui.ehp.bs.weixin.service;

import com.naiterui.ehp.bp.support.exception.BusinessException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;

/**
 * @author gaoliangliang
 * @date 2019/11/25 8:53 下午
 * @since 1.0.0
 */
public interface WechatService {

    void scan(String openId, String eventKey, WxMpService wxMpService) throws WxErrorException, BusinessException;

    /**
     * 关注回调
     *
     * @param openId
     * @param eventKey
     * @param weixinService
     *
     * @throws WxErrorException
     * @throws BusinessException
     */
    void subscribe(String openId, String eventKey, WxMpService weixinService) throws WxErrorException, BusinessException;

    /**
     * 取关回调
     *
     * @param openId
     * @param wxMpService
     *
     * @throws WxErrorException
     */
    void unsubscribe(String openId, WxMpService wxMpService) throws WxErrorException;

    /**
     * 菜单点击回调
     *
     * @param openId
     * @param eventKey
     * @param weixinService
     *
     * @throws WxErrorException
     */
    void menuClick(String openId, String eventKey, WxMpService weixinService) throws WxErrorException;

    /**
     * 验证小程序回调token
     * @param signature
     * @param timestamp
     * @param nonce
     * @param echostr
     * @return
     */
    String checkToken(String signature, String timestamp, String nonce, String echostr);

}
